#!/bin/sh

file=$(basename $0)
file=${file#numa-}

[ -f /sys/devices/system/node/node1/$file ] || exit 0

. $LKP_SRC/lib/wait.sh
setup_wait

if [ $file = 'vmstat' ]; then
	cat()
	{
		awk '!x[$1]++' "$@"
	}
fi

NODES=$(grep ^Node /proc/zoneinfo | awk '{print $2}' | sed -e 's/,//' | sort | uniq)
while :
do
	echo time: $(date +%s.%N)
	for NODE in $NODES
	do
		echo node: $NODE
		cat /sys/devices/system/node/node$NODE/$file
	done
	wait_timeout $interval
done
